//
//  BiPurchaseCheckViewController.m
//  TrunkIndustryManageSystem
//
//  Created by WT_lyy on 15/4/27.
//  Copyright (c) 2015年 李璐西. All rights reserved.
//

#import "BiPurchaseCheckViewController.h"


#import "BiPurChaseCarInfoEntity.h"
#import "BiPurchaseStockEntity.h"
@interface BiPurchaseCheckViewController (){

    __weak IBOutlet UIScrollView *_scrollview;
    
    __weak IBOutlet UITextView *_textfReason;
}

@property (weak, nonatomic) IBOutlet UILabel *labSupplyname;
@property (weak, nonatomic) IBOutlet UILabel *labBrand;
@property (weak, nonatomic) IBOutlet UILabel *labarcolor;
@property (weak, nonatomic) IBOutlet UILabel *labCarseries;
@property (weak, nonatomic) IBOutlet UILabel *labhouqsb;
@property (weak, nonatomic) IBOutlet UILabel *labhouqiao;
@property (weak, nonatomic) IBOutlet UILabel *labdriveroomtype;
@property (weak, nonatomic) IBOutlet UILabel *labdriveness;
@property (weak, nonatomic) IBOutlet UILabel *labdriveroomkind;
@property (weak, nonatomic) IBOutlet UILabel *labnotice;
@property (weak, nonatomic) IBOutlet UILabel *labzhouju;
@property (weak, nonatomic) IBOutlet UILabel *labbsxXhao;
@property (weak, nonatomic) IBOutlet UILabel *labfdjXhao;
@property (weak, nonatomic) IBOutlet UILabel *labCarPreforesale;

@property (weak, nonatomic) IBOutlet UILabel *labddsp;
@property (weak, nonatomic) IBOutlet UILabel *labztzgzc;
@property (weak, nonatomic) IBOutlet UILabel *labgzdsx;
@property (weak, nonatomic) IBOutlet UILabel *gzxxdfc;
@property (weak, nonatomic) IBOutlet UILabel *labcjpcdsx;
@property (weak, nonatomic) IBOutlet UILabel *labdpxxdfc;
@property (weak, nonatomic) IBOutlet UILabel *labdpsx;
@property (weak, nonatomic) IBOutlet UILabel *labgzsx;
@property (weak, nonatomic) IBOutlet UILabel *labztzzk;
@property (weak, nonatomic) IBOutlet UILabel *labzzkdfc;
@property (weak, nonatomic) IBOutlet UILabel *labztjxs;
@property (weak, nonatomic) IBOutlet UILabel *labxcck;
@property (weak, nonatomic) IBOutlet UILabel *labCarNumTotal;

@property (weak, nonatomic) IBOutlet UILabel *labPurchaser;
@property (weak, nonatomic) IBOutlet UILabel *labpurchaseNum;
@property (weak, nonatomic) IBOutlet UILabel *labCreattime;
@property (weak, nonatomic) IBOutlet UILabel *labApprover;

@property (weak, nonatomic) IBOutlet UILabel *labapproetime;


@end

@implementation BiPurchaseCheckViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNavBarTitle:@"订单审批"];
    
    [self setNavBarWithHidden:NO];
    
    [self setNavBackBtn];
    
    [self dataFill];
    [self setAutomaticallyAdjustsScrollViewInsets:YES];
    
    _scrollview.contentSize = CGSizeMake(MAIN_SCREEN_WIDTH,870);
    _textfReason.layer.borderColor = UIColorFromRGB(0xe5e5e).CGColor;
    _textfReason.layer.borderWidth = 1;
    _textfReason.layer.cornerRadius = 3;
    self.labCarNumTotal.textColor = UIColorFromRGB(ORANGE_COLOR_VALUE);

}


- (void)dataFill{
    
    BiPurChaseCarInfoEntity * carentity = self.centity.carEntity;
    
    BiPurchaseStockEntity * stockentity = self.centity.stockEntity;
    
    self.labSupplyname.text = self.centity.supplierName;
    self.labBrand.text = carentity.brand;
    self.labarcolor.text = carentity.carColor;
    self.labzhouju.text = carentity.wheelBase;
    self.labCarseries.text = carentity.carSeries;
    self.labdriveness.text = carentity.carDrive;
    self.labhouqiao.text = carentity.rearAxle;
    self.labnotice.text = carentity.announcementModel;
    self.labhouqsb.text = carentity.rearAxleRatio;
    self.labdriveroomtype.text = carentity.cabType;
    self.labdriveroomkind.text = carentity.cabModel;
    self.labbsxXhao.text = carentity.gearBoxModel;
    self.labfdjXhao.text = carentity.engineModel;
    
    self.labddsp.text = [NSString stringWithFormat:@"%d",(int)stockentity.orderApproval];
    self.labztzgzc.text = [NSString stringWithFormat:@"%d",(int)stockentity.refitting];
    self.labgzdsx.text = [NSString stringWithFormat:@"%d",(int)stockentity.refitStayOnline];
    self.gzxxdfc.text = [NSString stringWithFormat:@"%d",(int)stockentity.refitOffline];
    self.labcjpcdsx.text = [NSString stringWithFormat:@"%d",(int)stockentity.paichanStayOnline];
    self.labdpxxdfc.text = [NSString stringWithFormat:@"%d",(int)stockentity.chassisOffline];
    self.labdpsx.text = [NSString stringWithFormat:@"%d",(int)stockentity.chassisOnline];
    self.labgzsx.text = [NSString stringWithFormat:@"%d",(int)stockentity.refitOnelie];
    self.labztzzk.text = [NSString stringWithFormat:@"%d",(int)stockentity.zhongzhuanStorehouse];
    self.labzzkdfc.text = [NSString stringWithFormat:@"%d",(int)stockentity.zhongzhuanStorehouseStay];
    self.labztjxs.text =[NSString stringWithFormat:@"%d",(int)stockentity.dealerNum];
    self.labxcck.text = [NSString stringWithFormat:@"%d",(int)stockentity.nowStorehouse];
    self.labCarNumTotal.text = [NSString stringWithFormat:@"库存合计:%d",(int)stockentity.storehouseTotal];
    
    self.labpurchaseNum.text = self.centity.purchaseCount;
    self.labPurchaser.text = self.centity.userName;
    self.labApprover.text = self.centity.ratifyUserName;
    self.labapproetime.text = self.centity.ratifyTime;
    self.labCreattime.text = self.centity.createTime;
    
    _textfReason.text = self.centity.rejectReason;
}


- (IBAction)btnCheckClick:(UIButton *)sender {
    if (1 == sender.tag) {
        //批准
    }else if (2 == sender.tag){
        //驳回
    }
}


@end
